"""


Version: 0.1
Author: lk
Date: 2022-03-08
"""
import torch
from torch.utils import data
from torch.utils.data.dataset import T_co


def bacher(batch):
    # print("batcher...")
    x,y = zip(*batch)
    return 1

class MyDataset(data.Dataset):
    def __getitem__(self, index) -> T_co:
        return index,index + 1

    def __len__(self):
        return 10
if __name__ == '__main__':

    ds = MyDataset()
    data_loader = data.DataLoader(ds,collate_fn=bacher,batch_size=5)
    data_loader2 = data.DataLoader(ds,batch_size=5)
    for batch in data_loader:
        print(batch)
    for batch in data_loader2:
        print(batch)
